//
//  MyViewController.m
//  BigTyre
//
//  Created by 田涛 on 2017/3/15.
//  Copyright © 2017年 Lemon. All rights reserved.
//

#import "MyViewController.h"
#import "MySigninViewController.h"
@interface MyViewController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)UITableView * table;
@property(nonatomic,strong)NSArray * colorarr;
@end

@implementation MyViewController
-(void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden=NO;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor colorWithRed:117/255.0 green:211/255.0 blue:186/255.0 alpha:1.0];
    self.navigationController.navigationBar.hidden=YES;
    //底层图片
    UIImageView * image=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 450)];
    image.image=[UIImage imageNamed:@"1284889014433.jpg"];
    image.userInteractionEnabled=YES;
    [self.view addSubview:image];
    
    //用户头像
    UIButton * button=[UIButton buttonWithType:UIButtonTypeCustom];
    button.frame=CGRectMake(167, 100, 80, 80);
    [button setBackgroundImage:[UIImage imageNamed:@"qq头像"] forState:0];
    [button addTarget:self action:@selector(SkipSignInView) forControlEvents:UIControlEventTouchUpInside];
    [image addSubview:button];
    
    //登陆/注册按钮
    UIButton * button2=[[UIButton alloc]initWithFrame:CGRectMake(160, 200, 100, 30)];
    [button2 setTitle:@"登录 / 注册" forState:0];
    [button2 setTintColor:[UIColor whiteColor]];
    [button2 addTarget:self action:@selector(SkipSignInView2) forControlEvents:UIControlEventTouchUpInside];
    [image addSubview:button2];
    
    //表格
    _table=[[UITableView alloc]initWithFrame:CGRectMake(0,self.view.frame.size.height-580, self.view.frame.size.width, 530) style:UITableViewStylePlain];
    _table.userInteractionEnabled=YES;
    _table.backgroundColor = [UIColor clearColor];
    _table.contentInset=UIEdgeInsetsMake(150, 0, 0, 0);
    _table.delegate=self;
    _table.dataSource=self;
    [self.view addSubview:_table];
    
    //表格颜色数组
    _colorarr=@[[UIColor colorWithRed:253/255.0 green:101/255.0 blue:65/255.0 alpha:1.0],
        [UIColor colorWithRed:253/255.0 green:133/255.0 blue:68/255.0 alpha:1.0],
        [UIColor colorWithRed:253/255.0 green:160/255.0 blue:89/255.0 alpha:1.0],
        [UIColor colorWithRed:253/255.0 green:178/255.0 blue:82/255.0 alpha:1.0],
        [UIColor colorWithRed:185/255.0 green:195/255.0 blue:121/255.0 alpha:1.0],
        [UIColor colorWithRed:152/255.0 green:202/255.0 blue:151/255.0 alpha:1.0],
        [UIColor colorWithRed:117/255.0 green:211/255.0 blue:186/255.0 alpha:1.0]];
}


-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 75;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 7;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        
    }
    cell.backgroundColor=_colorarr[indexPath.row];
    cell.textLabel.text=@"asdfghjkl;";
    return cell;
}
-(void)SkipSignInView
{
    MySigninViewController * signin=[[MySigninViewController alloc]init];
    [self.navigationController pushViewController:signin animated:YES];
}
-(void)SkipSignInView2
{
    NSLog(@"========");
    MySigninViewController * signin=[[MySigninViewController alloc]init];
    [self.navigationController pushViewController:signin animated:YES];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
